/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package rejahealth.util;

import java.sql.Connection;
import rejahealth.model.Person;

/**
 *
 * @author Tiago Tiveron
 */
public class SqlTest {
    
    public static void main(String[] args) {
        Sql sql = new Sql();
        Connection connection;
        try {
            connection = sql.conectarBanco();
            
            //get person by id
            //Person person = new Person();
            //person = sql.getById(1);
            //System.out.println(person.getImc());
            
            //insert some values
            RandomPersonTemp random;
            Person person;
            for (int i = 0; i < 10; i++) {
                random = new RandomPersonTemp();
                person = new Person();
                person = random.getTempPerson();
                //String age, String height, String weight, String sex, String fat, String hydration, String humidity, String temperature) {
                sql.insert(person.getAge()+"", person.getHeight()+"", person.getWeight()+"", person.getSex()+"", person.getFat()+"", person.getHydration()+"", person.getHumidity()+"", person.getTemperature()+"");
            }
            
            //insert test
            //int result = sql.insere("12", "177" , "70", "Feminino", "14", "50", "40", "20","15");
            //if(result == 0) System.out.println("porra deu erro"); else System.out.println("Opaaaa, inseriu.");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    
}
